<%@page import="java.util.List"%>
<%@page import="com.web.entity.Student"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        <title>StudentList</title>
    <body>
        <div id="navdiv">
            <div class="top_navdiv">
                <div class="top_left">教师中心</div>
                <div class="identity">
                    <span>您好</span>
                    <div class="user_li">
                        <canvas id="myCanvas" width="100" height="30">
                        </canvas>
                    </div>
                </div>
            </div>
        </div>
        <div class="navbar  control_nav" >
            <div class="container"  style="margin-left: 300px; ">
                <ul class="nav navbar-nav navul">
                    <li class="col-md-2">
                        <a href="teacherApplyTest.jsp">申请/取消考试</a>
                    </li>
                    <li class="col-md-2">
                        <input type="hidden" name="ClassID" class="form-control" >
                        <a href="ssls">查看班级列表</a>
                    </li>
                    <li class="col-md-2">
                        <a href="SearchOneStudent.html">查询单个学生</a>
                    </li>
                    <li class="col-md-2">
                        <a href="sosgs">查询学生成绩</a>
                    </li>
                    <li class="col-md-2">
                        <a href="scgs">查询班级成绩</a>
                    </li>
                </ul>
            </div>
        </div>
        
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/newcss1.css"/>
        <link rel="stylesheet" href="css/mycss_foradim.css"/>
        <script src="js/script.js" charset="UTF-8"></script> 
        <script src="js/jquery-3.4.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script type="text/javascript" src="js/circle.js" charset="UTF-8"></script>
    </head>
    <a href="teacherInfo.jsp" style="margin-left: 1400px;">返回教师页面</a>
        <div class="container">
            <form class="form-inline text-center" >
                <label for="ClassID" name="ClassID">选择班级：</label>
                <select name="ClassID" id="ClassID" class="form-control"  style="width:150px;">
                    <option value="2018001">2018001</option>
                    <option value="2018002">2018002</option>
                    <option value="2018003">2018003</option>
                    <option value="2018004">2018004</option>
                </select>
                &nbsp;
                <button id="btn_searchList" class="btn btn-sm btn-primary" formaction="ssls" formmethod="GET">
                        查询
                </button>
            </form>
            <br>
            <table id="studentTable" class="table-condensed table-hover table-striped" style="width:1200px;">
                <tr>
                    <th class="text-center">学号</th>
                    <th class="text-center">姓名</th>
                    <th class="text-center">密码</th>
                    <th class="text-center">性别</th>
                    <th class="text-center">班级</th>
                </tr>
                <%
                    List<Student> s = (List<Student>)request.getAttribute("stu");
                    for(Student st : s){
                %>
                <tr id="tr<%=st.getSid() %>">
                    <td class="tda"><a style="color: black" href="javascript:showStudentModal('#tr<%=st.getSid() %>');"><%=st.getSid() %></a></td>
                    <td class="tda"><a style="color: black" href="javascript:showStudentModal('#tr<%=st.getSid() %>');"><%=st.getSname() %></a></td>
                    <td class="tda"><%=st.getSpwd() %></td>
                    <td class="tda"><%=st.getSgender() %></td>
                    <td class="tda"><%=st.getClassID() %></td>               
                </tr>
                <%
                    }
                %>
            </table>
</div>
<!--查看学生信息模态框-->
            <div class="modal fade" id="show_modal" tabindex="-1">
            <div class="modal-dialog">
                <div class="bg-warn modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title text-primary" id="myModalLabel">查看学生信息</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-inline" id="show_form">
                            <label for="sid">学生学号：</label>
                            <input id="sid" type="text" name="Sid" class="form-control">
                            <br><br>
                            
                            <label for="sname">学生姓名：</label>
                            <input id="sname" type="text" name="Sname" class="form-control">
                            <br><br>
                            
                            <label for="spwd">学生密码：</label>
                            <input id="spwd" type="text" name="Spwd" class="form-control">
                            <br><br>
                            
                            <label for="sgender">学生性别：</label>
                            <input id="sgender" type="text" name="Sgender" class="form-control">
                            <br><br>
                            
                            <label for="sclass">学生班级：</label>
                            <input id="sclass" type="text" name="ClassID" class="form-control">
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-info" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>
